use c24_2::c242_test;
use expr::{find24, C23Data};
use expr3::expr3_test;
mod c24;
mod expr;
mod expr2;
mod c24_2;
mod expr3;

fn main() {
    //test_calc2();
   // c242_test();
   expr3_test();
}

fn find24_test() {
    let nums = 0..=10;
    let mut count = 0;
    for a in nums.clone() {
        for b in nums.clone() {
            if a == b {
                continue;
            }
            for c in nums.clone() {
                if (a == c) || (b == c) {
                    continue;
                }

                for d in nums.clone() {
                    if (a == d) || (b == d) || (c == d) {
                        continue;
                    }

                    let data = C23Data {
                        a: a as f32,
                        b: b as f32,
                        c: c as f32,
                        d: d as f32,
                    };
                    let vec = find24(&data);
                    if vec.is_empty() {
                        continue;
                    }
                    count += vec.len();
                    print!("{} {} {} {} => ", a, b, c, d);
                    println!("{:#?}", vec);
                    println!();
                }
            }
        }
    }

    println!("count = {}", count);
}
